<template>
	<view class="container">
		<form>
			
			<view class="cu-form-group">
				<view class="title flex">开户银行<view class="require">*</view>
				</view>
				<input class="left" name="input" v-model="form.bank" ></input>
			</view>
			<view class="cu-form-group" >
				<view class="title flex">开户名称<view class="require">*</view>
				</view>
				<input class="left" name="input" v-model="form.bank_name" ></input>
			</view>
			<view class="cu-form-group">
				<view class="title flex">银行卡号</view>
				<input class="left" name="input" v-model="form.bank_no" ></input>
			</view>
			

			<view class="">

				<button class="cu-btn block bg-blue margin-tb-sm lg" @tap="save()" v-if="saving==false">
					保存</button>
				<button class="cu-btn block bg-blue margin-tb-sm lg" v-else>
					<text class="cuIcon-loading2 cuIconfont-spin"></text> 保存中</button>
			</view>
		</form>

	</view>
</template>

<script>
	
	export default {
		components: {
			
		},
		data() {
			return {
				saving:false,
				form: {},
				uId: 0,
			};
		},
		onLoad(options) {
			
			this.uId = uni.getStorageSync('userId');
			let obj = uni.getSystemInfoSync();
			let clientHeight = obj.screenHeight;
			this.scrollHeight = clientHeight - 150 + 'px';
			console.log(this.scrollHeight);
			let userInfo = uni.getStorageSync('userInfo');
			this.form ={
				bank:userInfo.bank,
				bank_name:userInfo.bank_name,
				bank_no:userInfo.bank_no,
			}
		},
		methods: {
			
			async save(){
				let t = this;
				t.saving = true
				console.log(t.imgList)
				console.log(t.userInfo);
				
				let param = t.form;
				param.uId = t.uId;
				let data = await this.$http.post(
					'wx/seeker_bank', //可以直接放链接(将不启用全局定义域名)
					param,
				);
				t.saving = false
				console.log(data);
				
				uni.showToast({
					title:'保存成功',
					icon:'none',
				})
				setTimeout(() => {
					// this.$api.msg(`保存成功`);
					uni.navigateBack({
						
					})
				}, 1500);
				return
				
				
			},
		
		}
	}
</script>

<style lang='scss'>
	page {
		background: $page-color-base;
	}

	.cu-list {
		overflow: hidden;
	}

	.require {
		color: #ff0000;
	}

	.left {
		text-align: right;
	}

	.list-cell {
		display: flex;
		align-items: baseline;
		padding: 4upx $page-row-spacing;
		line-height: 72upx;
		position: relative;
		background: #fff;
		height: 40px;
		justify-content: center;

		.user-img {
			height: 35px;
			width: 35px;
			overflow: hidden;
		}

		.cell-more {
			align-self: baseline;
			font-size: $font-lg;
			color: $font-color-light;
			margin-left: 10upx;
		}

		.cell-tit {
			flex: 1;
			font-size: 36upx;
			color: $font-color-dark;
			margin-right: 10upx;
		}

		.promote {
			padding: 5px;
			border: 1px solid #4CA5FE;
			border-radius: 6em;
			margin-left: 10px;
			color: #4CA5FE;
			font-size: 12px !important;
		}

		.cell-tip {
			font-size: 32upx;
			color: $font-color-light;
		}

		switch {
			transform: translateX(16upx) scale(.84);
		}
	}

	.cu-btn {
		height: 80rpx;
		width: 100%;
		position: fixed;
		bottom: 5px;
		box-shadow: 0px 3px 6px #4CA5FE;
	}

	.line {
		border-bottom: 1upx solid #F2F2F2;
	}

	.bottom {
		position: fixed;
		bottom: 0;
		width: 100%;

		.cell-tit {
			color: #FFFFFF !important;
			height: 44px;
		}
	}
</style>
